package Utils;

import java.util.Timer;
import java.util.TimerTask;

import DAO.GoodsDao;
import POJO.Goods;

public class TimerHelper {

	static GoodsDao goodsDao = new GoodsDao();

	public static void isTerminalReceive(final String orderNo,long time)
			throws Exception {
		 Timer timer = new Timer();
		 timer.schedule(new TimerTask() {
		 @Override
		 public void run() {
			 Goods goods = goodsDao.getGoodsByOrderNo(orderNo);
				if (goods!=null&&"1".equals(goods.getRemark())) {
					goodsDao.updateRemarkByOrderNo(orderNo, "4");
				}
		 }
		 }, time);
	}
}
